<?php

namespace app\common\util;

use OSS\Core\OssException;
use OSS\Credentials\Credentials;
use OSS\Credentials\CredentialsProvider;

class RewriteOssProvider implements CredentialsProvider
{
    /**
     * @return Credentials
     * @throws OssException
     */
    public function getCredentials()
    {
        global $globalConfig;
        $accessKeyId = $globalConfig['file_accessKeyId'];
        $accessKeySecret = $globalConfig['file_accessKeySecret'];
        return new Credentials($accessKeyId, $accessKeySecret);
    }
}